package cn.edu.scau.cmi.zhaoguangfeng.spring.server;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import cn.edu.scau.cmi.zhaoguangfeng.spring.bean.Student;
import cn.edu.scau.cmi.zhaoguangfeng.spring.bean.Teacher;

public class SpringServer implements ISpringServer {

	private ApplicationContext ac = new ClassPathXmlApplicationContext("spring.xml");

	public Student getStudentById(String beanId) {

		Student stu = (Student) ac.getBean(beanId);
		return stu;

	}

	public Teacher getTeacherById(String beanId) {

		Teacher t = (Teacher) ac.getBean(beanId);
		return t;

	}

	
}
